<?php
function sanitize($str) {
    $vowels = array(";", "|", "\"", "x00", "x08", "x7f", "x20", "x04", "x0D", "x1b", "*", "&lt;", "&gt;", "\'", "../", "./");
    $str = str_replace($vowels, "", $str);
    return $str;
}

$textlength=64;
$share_url="http://www.amazon.co.jp/%E3%82%B8%E3%83%A7%E3%82%B8%E3%83%A7%E3%81%AE%E5%A5%87%E5%A6%99%E3%81%AA%E5%86%92%E9%99%BA-Vol-1-%E7%AC%AC1%E9%83%A8%E3%82%AA%E3%83%AA%E3%82%B8%E3%83%8A%E3%83%AB%E3%82%B5%E3%82%A6%E3%83%B3%E3%83%89%E3%83%88%E3%83%A9%E3%83%83%E3%82%AF%E3%80%81%E5%85%A8%E5%B7%BB%E8%B3%BC%E5%85%A5%E7%89%B9%E5%85%B8%E3%83%95%E3%82%A3%E3%82%AE%E3%83%A5%E3%82%A2%E5%BF%9C%E5%8B%9F%E5%88%B8%E4%BB%98%E3%81%8D-%E5%88%9D%E5%9B%9E%E9%99%90%E5%AE%9A%E7%89%88-Blu-ray/dp/B009HIZNAS%3FSubscriptionId%3DAKIAIVUCVEO6SU6NZUFQ%26tag%3Dagniuek-22%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3DB009HIZNAS";
$share_text="ジョジョの奇妙な冒険 Vol.1  (第1部オリジナルサウンドトラック、全巻購入特典フィギュア応募券付き)(初回限定版) [Blu-ray]' ><p>ジョジョの奇妙な冒険 Vol.1  (第1部オリジナルサウンドトラック、全巻購入特典フィギュア応募券付き)(初回限定版) [Blu-ray]";

if(isset($_GET['u'])){
    $share_url= $_GET['u'];
}
if(isset($_GET['t'])){
    $share_text= $_GET['t'];
}


$volm = strlen(bin2hex($share_text)) / 2;
//echo "volm=$volm";
if($volm > $textlength){
    $share_text = substr($share_text,0,$textlength)."...";
    //echo $share_text;
}
$twitter_button = "";
    $twitter_button.="<div >";
    $twitter_button.="<a href='https://twitter.com/share' class='twitter-share-button' data-url='" . $share_url . "'".  " data-text='". $share_text ."'" ." data-count='none'>Tweet this</a>";
    $twitter_button.="</div>";
?>
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
    <link rel="stylesheet" href="/css/sns.css" />
</head>
<body>
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
<div>

   <a href="http://twitter.com/share" class="twitter-share-button"

      data-url="<?php echo $share_url?>"
      data-text="<?php echo $share_text?>"
      data-related="mobazon.hyperstylelab"
>Tweet</a>

</div>
</body>
</html>
